﻿using System;
using Kele.Activity.Helper;
using Newtonsoft.Json;

namespace Kele.Activity.Models
{

    /// <summary>
    /// 活动记录
    /// </summary>
    public class Record
    {

        public int id { get; set; }

        [JsonIgnore]
        public string body { get; set; }

        /// <summary>
        /// 活动ID
        /// </summary>
        public int activity_id { get; set; }

        /// <summary>
        /// FormID
        /// </summary>
        public int form_id { get; set; }

        /// <summary>
        /// 订单ID
        /// </summary>
        public string order_id { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public string user_id { get; set; }

        /// <summary>
        /// 支付状态 0未支付，1已支付，2免费，4退款
        /// </summary>
        public Activity_Record_Status status { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        public string mobile { get; set; }

        /// <summary>
        /// 必填字段
        /// </summary>
        [JsonConverter(typeof(StringJsonConverter))]
        public string fields { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int num { get; set; }

        ///// <summary>
        ///// 价格
        ///// </summary>
        //public string price { get; set; }

        ///// <summary>
        ///// 预付价格
        ///// </summary>
        //public string pre_price { get; set; }

        /// <summary>
        /// 付款金额
        /// </summary>
        public decimal pay_fee { get; set; }

        /// <summary>
        /// 付款时间
        /// </summary>
        public DateTime? pay_time { get; set; }

        ///// <summary>
        ///// 到店支付金额
        ///// </summary>
        //public decimal store_charge { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime created { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? modified { get; set; }

        /// <summary>
        /// 核销人员ID
        /// </summary>
        public string verfiy_uid { get; set; }

        /// <summary>
        /// 核销时间
        /// </summary>
        public DateTime? verify_time { get; set; }

        /// <summary>
        /// 退款人员ID
        /// </summary>
        public string refund_uid { get; set; }

        /// <summary>
        /// 退款时间
        /// </summary>
        public DateTime? refund_time { get; set; }

        ///// <summary>
        ///// 活动别名
        ///// </summary>
        //public string activity_alias { get; set; }

        /// <summary>
        /// 活动属性
        /// </summary>
        public string props { get; set; }

        /// <summary>
        /// 活动标识
        /// </summary>
        public Activity_Record_Flag flag { get; set; }

        /// <summary>
        /// 活动角色
        /// </summary>
        public int role { get; set; }
        /// <summary>
        /// 报名序号
        /// </summary>
        public int sort { get; set; }

    }

    /// <summary>
    /// 活动记录-角色
    /// </summary>
    public enum Activity_Record_Role
    {
        /// <summary>
        /// 无角色
        /// </summary>
        none = 0,

        /// <summary>
        /// 团购团长
        /// </summary>
        group_lead = 1,

        /// <summary>
        /// 团购团员
        /// </summary>
        group_member = 2
    }

    /// <summary>
    ///活动记录-支付状态
    /// </summary>
    public enum Activity_Record_Status
    {
        /// <summary>
        /// 未付款
        /// </summary>
        unpaid = 0,

        /// <summary>
        /// 已支付
        /// </summary>
        paid = 1,

        /// <summary>
        /// 免费
        /// </summary>
        free = 2,

        /// <summary>
        /// 已退款
        /// </summary>
        refunded = 4
    }



    /// <summary>
    /// 活动记录-标示
    /// </summary>
    public enum Activity_Record_Flag
    {
        /// <summary>
        /// 无状态/未成团
        /// </summary>
        none = 0,

        /// <summary>
        /// 完成：付款/成团
        /// </summary>
        completed = 1,

        /// <summary>
        /// 过程中: 
        /// </summary>
        in_progress = 2,
    }
}